UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fz/hhrrwYolvOcYRfT9EGt+bv0FJ8hCWj7pu2n+Z2K8=' 
WHERE 
  key_id = '29edc827e54a4bd879afdba538b1e2376bf8dae28e17a4b03cb04f574f7de20d' 
  AND (
    token = 'Fz/hhrrwYolvOcYRfT9EGt+bv0FJ8hCWj7pu2n+Z2K8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029