UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k7di+luyON3fOiM065DlzsOt8oTB2QyFZxifyJWoOZA=' 
WHERE 
  key_id = 'c104ee185473d596fd21af3ced821633d29e4c4caffba34676f3ebadf7b0c36a' 
  AND (
    token = 'k7di+luyON3fOiM065DlzsOt8oTB2QyFZxifyJWoOZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00094