UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9wT+293i8dCx2Cktp3nfJStjUWQG8TMPiYVPkBxArxs=' 
WHERE 
  key_id = '484c2217edf125535dfbbd60f7c1aa9131c0310ba395567f66dbd58b86cbebb8' 
  AND (
    token = '9wT+293i8dCx2Cktp3nfJStjUWQG8TMPiYVPkBxArxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034