UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rkD4weu5HNd/pow2ShuPDq/H6acsZ83Z2WSEzYPyNLU=' 
WHERE 
  key_id = '0e90b25a54dd04b2335d3353f5ec208a3dd5650e17a2b4ab60dce94f843d80f1' 
  AND (
    token = 'rkD4weu5HNd/pow2ShuPDq/H6acsZ83Z2WSEzYPyNLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028