UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rajqs6uOtkwUf6ZmLFveHr/NN1ddROn6n0hylwP1jc=' 
WHERE 
  key_id = '656e541d446c6ae1d3a40cc2ed6952415512ca76e8b8643d31a5803969f9855b' 
  AND (
    token = '1rajqs6uOtkwUf6ZmLFveHr/NN1ddROn6n0hylwP1jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031