UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l9dm5waH77SpbYa3J2rY5eFvYNpJGdEbLg+3dN3MDL0=' 
WHERE 
  key_id = '24ef116191f8606d33cd09b17aa6423c7a9aa0110dfb736b59cb47361446b746' 
  AND (
    token = 'l9dm5waH77SpbYa3J2rY5eFvYNpJGdEbLg+3dN3MDL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071