UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JBMrIbyda8aR3QX366bK9V2AZOIdJULybOMkQsRcfAM=' 
WHERE 
  key_id = '6f34e6c8265b9e909bc8fed8e3c35f41a94153c65f9cc681b4ed9165811d6847' 
  AND (
    token = 'JBMrIbyda8aR3QX366bK9V2AZOIdJULybOMkQsRcfAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031