UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wbzi4J0GWkZcUL7B5zYoVtHh6m7vbg7wIJbKO03im5Y=' 
WHERE 
  key_id = '03572eb62771d716b1b07f05ea40e08df5106c4900bb6db9cb1e3c9fb05fbd40' 
  AND (
    token = 'Wbzi4J0GWkZcUL7B5zYoVtHh6m7vbg7wIJbKO03im5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021