UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qs/FJQS+UeVzQPD/QzbyzW3Uq96BNScLGODBA8npUqM=' 
WHERE 
  key_id = 'a4c9d27b25012d78f98e025f75632dc67d3179d45ea89479592d019c71c6dd77' 
  AND (
    token = 'qs/FJQS+UeVzQPD/QzbyzW3Uq96BNScLGODBA8npUqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018