UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RbFf1jaRUI9EPq5fnJZh4F8jJSNA74NswbFD8MfmeiU=' 
WHERE 
  key_id = '17ec7c0f5bb770babbe96feb73dde0abbdb72ca500fef5e528ca597f33c3d7b3' 
  AND (
    token = 'RbFf1jaRUI9EPq5fnJZh4F8jJSNA74NswbFD8MfmeiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019