UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wxHf7051SXQ03qx2rpAKSB+Jr5217j6ZnEyvY/K/Ht0=' 
WHERE 
  key_id = '99461ef5295394a450b079758c43bd3f4cbf09b2300164dbcf52f29c699034c0' 
  AND (
    token = 'wxHf7051SXQ03qx2rpAKSB+Jr5217j6ZnEyvY/K/Ht0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025