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