UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mX9MjvlAdsPp49qnP+d8oab/kx2MhGQOoRyig3jl9hQ='
WHERE
key_id = '96835ecdc945cb3ea2e4829246fa2c7e94bff465736c0f1d2c618a5e9f86488b'
AND (
token = 'mX9MjvlAdsPp49qnP+d8oab/kx2MhGQOoRyig3jl9hQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)