UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LKfVs2RMfY49Oanxbnc8V+pGJgFp7kPIZjixWiehqJ8=' 
WHERE 
  key_id = '0896809f89935e46c40f95eb6d3cdc3b8d5945d0dc88fc220938745159e90735' 
  AND (
    token = 'LKfVs2RMfY49Oanxbnc8V+pGJgFp7kPIZjixWiehqJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025