UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Po8UEHdcS9hHhdn6XuoIcP2eCJlcDwsFmB5qlAgBnMQ=' 
WHERE 
  key_id = '5a90f452d99c4403411b9e17ba96ea662f2927e86d29e5fd6044e8e9c86774e2' 
  AND (
    token = 'Po8UEHdcS9hHhdn6XuoIcP2eCJlcDwsFmB5qlAgBnMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020