UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zMMPe6Xd8HCeBErf7XHMWrcNlwKq3NoJzBd+RAkRQgo='
WHERE
key_id = '3bfc5700a878fa82b1a1513132f88f0c4375698d4ff963ed48378c73c3258c39'
AND (
token = 'zMMPe6Xd8HCeBErf7XHMWrcNlwKq3NoJzBd+RAkRQgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)