UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81Zd+QCoHvEUwBRHt/z+mJOd9zoDAVgFabTb+PYpEJo=' 
WHERE 
  key_id = 'd375cb5b041ec0e3e36b7ed44076809e4ae26d56c137bcc9b65497c14b85e43a' 
  AND (
    token = '81Zd+QCoHvEUwBRHt/z+mJOd9zoDAVgFabTb+PYpEJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042