UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rgrY3mT6cxIh4KdZOJ14h88f0Z8J/W95dLZZ8B6WSCE='
WHERE
key_id = '46c1db16f5d9f9a812a5e0efe9d63f81b76c4b04d4e891a77f9c9b8199137192'
AND (
token = 'rgrY3mT6cxIh4KdZOJ14h88f0Z8J/W95dLZZ8B6WSCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)