UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wK9et5RrBF4uQQorL2JX3J5+eU/4zpjfcLRj9IRtcDE=' 
WHERE 
  key_id = 'a142042224160342bebb900f0129652ff22f37c981a12517e02932be64564302' 
  AND (
    token = 'wK9et5RrBF4uQQorL2JX3J5+eU/4zpjfcLRj9IRtcDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016