UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WA1inJkP6+h9rqZ6LQvkUXxeE2EHx1LieR559rfWhhA=' 
WHERE 
  key_id = 'b8dd53537009453df6adcc2f017a5d57176c8e20115c83004bf5687a0711d30d' 
  AND (
    token = 'WA1inJkP6+h9rqZ6LQvkUXxeE2EHx1LieR559rfWhhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037