UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5SIn/yqUq+6+g+hrI5qeUYbWxCIxOVC9bljPPdivwqk='
WHERE
key_id = 'ceb24627af22cc0092a268f07732a7cffdaa623d2411758a6ffe4730dab66244'
AND (
token = '5SIn/yqUq+6+g+hrI5qeUYbWxCIxOVC9bljPPdivwqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)