UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's95fvEYvSYy8tGTw23wJC097XTch0n2271yfCoDRn3k=' 
WHERE 
  key_id = 'f73d028994e3c0b245f670226b8dbcb8699c78781c8343a81621dadb884710eb' 
  AND (
    token = 's95fvEYvSYy8tGTw23wJC097XTch0n2271yfCoDRn3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051