UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZ+PzhbOXBYeY5JynK7GCLKZUVdwPyEV569TkJIRq7A='
WHERE
key_id = '231d106c34891ec208479d6f4e0b68ba2f39477a498294849cbf9d2829c497d3'
AND (
token = 'LZ+PzhbOXBYeY5JynK7GCLKZUVdwPyEV569TkJIRq7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)