UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RKrWhNY71EtjE+2V8fw5NjfVI65ya3u/aMfSTD9pkeA='
WHERE
key_id = '6fb5bac41c3262634c5a7a1d5fb0aa34ad6f5742e2470cbb6f1dd4d903ce21f3'
AND (
token = 'RKrWhNY71EtjE+2V8fw5NjfVI65ya3u/aMfSTD9pkeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)