UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1hG/AhoM68F/5rCPE5FfxWhT5re/6Gp+bwx4gDwRRxU=' 
WHERE 
  key_id = 'bffef0ec0549dbcae247cd97fae5c0d79321f06bfaa94b3fd5929774f28a258e' 
  AND (
    token = '1hG/AhoM68F/5rCPE5FfxWhT5re/6Gp+bwx4gDwRRxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030