UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vrsE2EkLVxtmwBUMS9hxynfYJNcAq0zQEl4A3UAaM1E='
WHERE
key_id = 'b984242d08bf928182752850a5ad06ce8f0e05e786c96b89952d321b6da3d396'
AND (
token = 'vrsE2EkLVxtmwBUMS9hxynfYJNcAq0zQEl4A3UAaM1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)