UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JjXdX4iu+2ZXnpQKy0M+KoxjLN0KXz+vKFwDZ8bqHI=' 
WHERE 
  key_id = 'f65632c4e4f120f1b3816fd44d8a47c7ce6547f10e0b7baf8655aee2e96f75a1' 
  AND (
    token = '5JjXdX4iu+2ZXnpQKy0M+KoxjLN0KXz+vKFwDZ8bqHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026