UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd3IJzGfT8DeBgxh7DFCXNxg5ZJPjXdmbwQkEdyqvGWk='
WHERE
key_id = '285893ffd72ca161bac1ce7ee78c7214b4bbb48640912b66fae6fe4b83afaaf2'
AND (
token = 'd3IJzGfT8DeBgxh7DFCXNxg5ZJPjXdmbwQkEdyqvGWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)