UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xgIDeYOjJ0TR6RjzInQDq0Z8dPDPpyW/Vqb9l8rLx0I='
WHERE
key_id = 'e9ec053800ff23b6d7e58feead4733ee02c3f995dc62805f1d3de3ca9deff09f'
AND (
token = 'xgIDeYOjJ0TR6RjzInQDq0Z8dPDPpyW/Vqb9l8rLx0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)