UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QFt/w853oQIeA/02uUrkupvO7tks2XERUF1Nfg3iMAM=' 
WHERE 
  key_id = 'c2edee9eb9e6f85cbacb6f56f2f1004a6b8a2ad7eb869a7a52b8dd2da431dfbf' 
  AND (
    token = 'QFt/w853oQIeA/02uUrkupvO7tks2XERUF1Nfg3iMAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030