UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fN/4bsal/IWFSCXYJMU6ng9ecB7UN0I1JJOFdZDhslU='
WHERE
key_id = '14f664bc7b920e4abb8ab44072264601c53fbbaa8d9d82a35370666ebd0df1b9'
AND (
token = 'fN/4bsal/IWFSCXYJMU6ng9ecB7UN0I1JJOFdZDhslU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)