UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdwJdvbYubdttcD/4y7Kyfkg0QlRblRWZg5SxWMpT3c=' 
WHERE 
  key_id = '67f53686beed40b8accf0daeffdbe76761ece1f8ca9f429105a9ce0277f03498' 
  AND (
    token = 'rdwJdvbYubdttcD/4y7Kyfkg0QlRblRWZg5SxWMpT3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026