UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MrwqZ/GReb2KvXRi1V6xOF5Mfmr7OQLn++ASczIIEZ4='
WHERE
key_id = '50bb0ee34697700b3de1dc7c0d0385dabe69ac0dd9d3a0df5b16a3933cb804e2'
AND (
token = 'MrwqZ/GReb2KvXRi1V6xOF5Mfmr7OQLn++ASczIIEZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)