UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wPummGroeL5CXKWESBQs/aYoFUTxCczg3Q1MQPpSUKY=' 
WHERE 
  key_id = 'cb732b5a0467b121cd60be856734c9ef64813086219998ff97516f38a12095bf' 
  AND (
    token = 'wPummGroeL5CXKWESBQs/aYoFUTxCczg3Q1MQPpSUKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016