UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0sa3OUJQ30TYvgjcrjo+oKu4jVc/cAI4WbPssEOfXVY=' 
WHERE 
  key_id = '7533f5116a92277ce5e3396e6eef8f916dabc2b7c575068b6e28feb82741e85b' 
  AND (
    token = '0sa3OUJQ30TYvgjcrjo+oKu4jVc/cAI4WbPssEOfXVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043