UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AcJ5sJIAidZkhD5Fql3l9nJUvEsDu81JxHFQaI145jY=' 
WHERE 
  key_id = '30edaa48ea8c9db9c53b2d479085770c756a1de396180fafcca51916a918e5f9' 
  AND (
    token = 'AcJ5sJIAidZkhD5Fql3l9nJUvEsDu81JxHFQaI145jY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057