UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x+p76gmQ3Qby4WbKSVMzEB/6LfeSsDBQt70E76TPsbU=' 
WHERE 
  key_id = '9630cba906ed759c1fa9d80b6c78486a6fa424af904e6a755d3a756524c428a6' 
  AND (
    token = 'x+p76gmQ3Qby4WbKSVMzEB/6LfeSsDBQt70E76TPsbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050