UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GnXjivibCtFtGOX5aLlc5OZiGXNmmYuORVJ5vJ6Tmv0='
WHERE
key_id = '089bbabc623f4b6e6ecfb92a0f280bd71475560abbba70f539857e73ee289503'
AND (
token = 'GnXjivibCtFtGOX5aLlc5OZiGXNmmYuORVJ5vJ6Tmv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)