UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5dNwM/Pfwygwe+wF3Lo2fHUcwaVtX0g8i38VwJiZs8s=' 
WHERE 
  key_id = '49eb5bf56c2dd6d9d0f6b235caab4ed224c659888301c90ab7b94dc3e218f945' 
  AND (
    token = '5dNwM/Pfwygwe+wF3Lo2fHUcwaVtX0g8i38VwJiZs8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040