UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49jd+yYRZVrqDLJiiCKov9rBXpdFPaVikkA8po2ZJak=' 
WHERE 
  key_id = '3adbc9e10dd38401fa5ee6724e3d729a9cb26aea4825e8948987e37cb5df1f9c' 
  AND (
    token = '49jd+yYRZVrqDLJiiCKov9rBXpdFPaVikkA8po2ZJak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026