UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '64kMhQgevp+1URjK+WCb+zaiHHo+lHltjnfNwank5XM='
WHERE
key_id = '9ba586b26f43740ec49465b602bb7b8e16b7b05e7912cd70ae220fd0bf9c00b1'
AND (
token = '64kMhQgevp+1URjK+WCb+zaiHHo+lHltjnfNwank5XM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)