UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VsDlLe9lPARH7hjOqa55Rq7E+188UXHh7VOen2H1v8U=' 
WHERE 
  key_id = '7c5b9e1400cf74905336b30576cefb2c469c68a0e0b85d22354d04302c66196b' 
  AND (
    token = 'VsDlLe9lPARH7hjOqa55Rq7E+188UXHh7VOen2H1v8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041