UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ewNEjjCpn0+Ka5mWuY2aFY5T+X4sOHfPjmB+TtJAoIA=' 
WHERE 
  key_id = '8f5df4cdd228351ddd138db535dd515e6305f42c0f0d2f895e76e0c806ef70f6' 
  AND (
    token = 'ewNEjjCpn0+Ka5mWuY2aFY5T+X4sOHfPjmB+TtJAoIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022