UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9k0DFOntsyyPlmyN6Yb6e4u5KiWwdofzTK2iaSX7S/w='
WHERE
key_id = '6ed2d26ef8f8ce36acb51e3eed851a8086d758a4341fb9d90dca8fa438ec58f0'
AND (
token = '9k0DFOntsyyPlmyN6Yb6e4u5KiWwdofzTK2iaSX7S/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)