UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oiTEWIOZ7fu703uI7c5B58Poivinon7NsMEfjrxxqY8=' 
WHERE 
  key_id = '7136e2b62a3f3da4f7256c3fa7e6caf487d53cdb4848706fad296aae918dafca' 
  AND (
    token = 'oiTEWIOZ7fu703uI7c5B58Poivinon7NsMEfjrxxqY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022