UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L3PYfZ4Za9o/uJO5fkU+mwgyCIhI37PZ4bi/+HMbNbI=' 
WHERE 
  key_id = '3d312f7b74a38ab4cba25ec257ccb4ac9355427baab3f36d90c47bea33640994' 
  AND (
    token = 'L3PYfZ4Za9o/uJO5fkU+mwgyCIhI37PZ4bi/+HMbNbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028