UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlKbYGTwzmjrO6+lqzfliD7cGfh14jrmOJ84Dq4X4HA=' 
WHERE 
  key_id = '6362e57cd3620c039f4d194ccd4f34be3b29b052694faf29d80e50158425eaaf' 
  AND (
    token = 'YlKbYGTwzmjrO6+lqzfliD7cGfh14jrmOJ84Dq4X4HA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020