UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vb+rw2/bVdqZIHpuSSf1l7OA4tafjIadE6wp8vIBA1Q='
WHERE
key_id = 'fa2b3e932e080c970df5036037e09b67e3f5d854106f83c49a2197daa4bbc262'
AND (
token = 'Vb+rw2/bVdqZIHpuSSf1l7OA4tafjIadE6wp8vIBA1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)