UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4HpKnoD6yZMac4Mo/wsMuWOBBvL4XVNcKgFntuwVcZ4=' 
WHERE 
  key_id = '8ff538fdcd70cdfd9f540d237dc1253bf3f9c42a81d255b8aa7763a103c5bd67' 
  AND (
    token = '4HpKnoD6yZMac4Mo/wsMuWOBBvL4XVNcKgFntuwVcZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026