UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xErM/EUZiTxuO0dn8kcXDjOeW9tji9RIUJeL+hKqyJU='
WHERE
key_id = '7b27ef72b02e3d23eda1c98e727ccfe4fa8ec4b47643c0da4d1c79bd6bd1aabd'
AND (
token = 'xErM/EUZiTxuO0dn8kcXDjOeW9tji9RIUJeL+hKqyJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)