UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VnE3xoViI+Y0Lx2/kbjQFrPXAKybHRwlW367IH1SGiY=' 
WHERE 
  key_id = 'bc005a5197cc8780000d564a50caa591ae7c76a302384658cac06131a2e631a7' 
  AND (
    token = 'VnE3xoViI+Y0Lx2/kbjQFrPXAKybHRwlW367IH1SGiY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041