UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VW9wV4UY/VTY3F8V0guKYq55fS6JznLnsNlXSL9XQGY='
WHERE
key_id = 'db8dc01821e33942b2211a182feb62167b30b13540bcec8a9d77c9b444cc127a'
AND (
token = 'VW9wV4UY/VTY3F8V0guKYq55fS6JznLnsNlXSL9XQGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)