UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M4+tX/1ShkyL67yEGq4aXp4Lwh1aCp5R6WFAAOZPla8='
WHERE
key_id = 'ff47ed1079d07d3e65cf46ee26222a15bd30a7495774661ae5ed4293bfb8d4cc'
AND (
token = 'M4+tX/1ShkyL67yEGq4aXp4Lwh1aCp5R6WFAAOZPla8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)