UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HXp2ytxyr8cVHfIRLDVviWMntsC9T90HOzVfvgJIlWo=' 
WHERE 
  key_id = '5bbacb9f8e89c0a8a9d6d42ab4f4433bccde4ff33a7f130034957a08514d55ee' 
  AND (
    token = 'HXp2ytxyr8cVHfIRLDVviWMntsC9T90HOzVfvgJIlWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039