UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tJHwNgdp5cuyPqY4pEjg83i6TPIOzEJ2KvzmZ85iqHM='
WHERE
key_id = '0c36294212cd29a0f964822683721877b43468f7c6a0fb637843e90c3bb34ba6'
AND (
token = 'tJHwNgdp5cuyPqY4pEjg83i6TPIOzEJ2KvzmZ85iqHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)