UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2RoLkh8ezgvl2IBz8nlcBOz526GZNFCUv1ef75ppgCs='
WHERE
key_id = 'cf2e5599a66e74467cd6d1259b45249db330e64a5484b545c12a64f188edb7a0'
AND (
token = '2RoLkh8ezgvl2IBz8nlcBOz526GZNFCUv1ef75ppgCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)