UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EgUGceowt/mqT7aYR8FnB5OHkePZA8THmdUfsmhM/84='
WHERE
key_id = '9891f5691bcd7579eac079a1ba34270c679eb4477eaf6405817e179826cc8a3c'
AND (
token = 'EgUGceowt/mqT7aYR8FnB5OHkePZA8THmdUfsmhM/84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)