UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a+hGgkMMBBghvAfLTM8ED1+aA5i06hymQP4PncGUY+s='
WHERE
key_id = '4f32f57340222720b853807868dc3a51ed68f4eb7c95813387623c6da0a47ece'
AND (
token = 'a+hGgkMMBBghvAfLTM8ED1+aA5i06hymQP4PncGUY+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)